<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
		<meta name="author" content="金西振" />
		<title></title>
		<style></style>
	</head>
	<body>
		<a href="./new.html" target="_blank">新页面</a>
		<button onclick="newClick()">打开新的地址</button>
		<button onclick="loadClick()">重新加载</button>

		<script>
      // 浏览器位置对象：获取浏览器地址栏url相关的信息
			console.log(location);

			// 获取页面的url地址
			console.log(location.href);
			function newClick() {
				location.href = './new.html'; // 打开新的地址
			}
			function loadClick() {

        // 相当于F5，刷新页面
				location.reload();
			}
		</script>
	</body>
</html>
